package com.lebang.common.util;

import com.lebang.model.enums.buss.RecordStatus;
import com.lebangweb.response.Callback;
import com.lebangweb.response.JsonData;

/**
 * @Author: hwq
 * @Date: 2019/6/4 18:07
 * @Version 1.0
 */
public class JsonDataUtil {
    /**任务状态转换工具*/
    public static JsonData toJsonData(RecordStatus statu){
        if (statu.isStatus()){
            return Callback.success("success",statu.getMsg(),null);
        }else {
            if(statu.equals(RecordStatus.EXIT)){
                return Callback.fail("800",statu.getMsg(),statu.getObject());
            }else {
                return Callback.fail("fail",statu.getMsg(),null);
            }

        }
    }
}
